package com.interview.score.utils;

import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.time.LocalTime;

@Component
public class TimeUtils {

    public String getCurrentTime() {
        LocalDate currentDate = LocalDate.now(); // 获取当前日期
        LocalTime currentTime = LocalTime.now(); // 获取当前时间
        System.out.println(currentTime);
        LocalTime localTime = currentTime.plusMinutes(8);
        System.out.println(localTime);
        int hour = currentTime.getHour(); // 获取当前小时
        int minute = currentTime.getMinute(); // 获取当前分钟
        int second = currentTime.getSecond(); // 获取当前秒钟
        String timeResult= hour + ":" + minute + ":" + second;
        return timeResult;
    }
}
